﻿using System;
using System.Html.DOM;

namespace jQueryLib
{
    public abstract class JQueryEvent
    {
        /// <summary>
        /// The DOM element that initiated the event.
        /// </summary>
        public readonly HtmlElement Target;

        /// <summary>
        /// The other DOM element involved in the event, if any.
        /// </summary>
        public readonly HtmlElement RelatedTarget;

        /// <summary>
        /// The mouse position relative to the left edge of the document.
        /// </summary>
        public readonly int PageX;

        /// <summary>
        /// The mouse position relative to the top edge of the document.
        /// </summary>
        public readonly int PageY;

        /// <summary>
        /// For key or mouse events, this property indicates the specific key or button that was pressed.
        /// </summary>
        public readonly int Which;

        /// <summary>
        /// Returns whether event.preventDefault() was ever called on this event object.
        /// </summary>
        /// <returns></returns>
        public abstract bool IsDefaultPrevented();

        /// <summary>
        /// Returns whether event.stopImmediatePropagation() was ever called on this event object.
        /// </summary>
        /// <returns></returns>
        public abstract bool IsImmediatePropagationStopped();

        /// <summary>
        /// Returns whether event.stopPropagation() was ever called on this event object.
        /// </summary>
        /// <returns></returns>
        public abstract bool IsPropagationStopped();

        /// <summary>
        /// If this method is called, the default action of the event will not be triggered.
        /// </summary>
        public abstract void PreventDefault();

        /// <summary>
        /// Prevents other event handlers from being called.
        /// </summary>
        public abstract void StopImmediatePropagation();

        /// <summary>
        /// Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event.
        /// </summary>
        public abstract void StopPropagation();
    }
}
